//
//  ScriptMessageHandler.swift
//  MECollege
//
//  Created by 马康旭 on 2017/9/1.
//  Copyright © 2017年 马康旭. All rights reserved.
//

import UIKit
import WebKit


class ScriptMessageHandler: NSObject {

    weak var delegate: WKScriptMessageHandler?
    
    deinit{
        MELog(111)
    }
}


extension ScriptMessageHandler: WKScriptMessageHandler {
    
    func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
        
        //代理响应捕获到的事件
        if let target = delegate{
            
            target.userContentController(userContentController, didReceive: message)
        }
    }
}




